<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/util_file/common_basics.jspf"%>
<link rel="stylesheet" type="text/css" media="screen" href="/jeons/css/default.css" />
<script type="text/javascript">
	$(document).ready(function(){
		
		$("#status").change( function(){
			$("#search").submit();
		});
		
		
		//파람값 적용
		if ($("#param_status").val()!=null) {
			$("#status").val($("#param_status").val()).attr('selected', 'true');
		}
		
		$("[name=tmp]").click( function(){
			
			if ($(this).attr('status').length == 0 ) {
				location.href = '/jeons/admin/buildproduct/qna/insert?qnano='+$(this).attr('qnano');
			}else{
				location.href = '/jeons/admin/buildproduct/qna/view?qnano='+$(this).attr('qnano');
			} 
		});
	});
</script>
<input type="text" id="param_status" value="${param.status}" />
<div id="default">
<form method="get" id="search">
<table  border="0" width="675px">
	<tr>
		<th>선택</th>
		<Td>
			<select name="status" id="status">
				<option value="">선택</option>
				<option value="confirmation">확인</option>
				<option value="waiting">대기중</option>
			</select>
		</Td>
	</tr>
</table>
</form>
<Br>

	<table  border="0" width="675px">
		<tr>
			<td colspan="5" bgcolor="#000000" height="1"></td>
		</tr>
		<tr>
			<th align="center">번호</th>
			<th align="center" width="400px">제목</th>
			<th align="center">공개여부</th>
			<th align="center">현재상태</th>
			<th align="center">작성일</th>
		</tr>
		<tr>
			<td colspan="4" bgcolor="#ffffff" height="1"></td>
		</tr>
		<c:forEach items="${data}" var="item" varStatus="status">
		<tr>
			<td align="center">번호</td>
			<td align="center" name="tmp" qnano="${item.qnano}" status="${item.status}" >${item.title} ${item.status}</td>
			<td align="center">
				<c:if test="${item.open != null}">
					<img src="/jeons/images/key.gif"/>
				</c:if>
			</td>
			<td align="center">
			
				<c:if test="${item.status == 'confirmation'}">
					확인
				</c:if>
				<c:if test="${item.status != 'confirmation'}">
					대기중
				</c:if>
			</td>
			<td align="center"><fmt:formatDate value="${item.rg}" pattern="yyyy-MM-dd hh:mm:ss"/></td>
		</tr>
		</c:forEach>
		<tr>
			<td colspan="5" bgcolor="#ffffff" height="1"></td>
		</tr>
		<tr>
			<td colspan="5" bgcolor="#ffffff" height="1"></td>
		</tr>
	</table>
<div align="center">
	${page}
</div>		
<div align="right">
</div>
</div>	


    